package com.gitee.wsl.time.chinese

import kotlin.test.Test
import kotlin.test.assertEquals


class NineStarTest {
    @Test
    fun test1() {
        val lunar: Lunar = Solar.fromYmd(1985, 2, 19).lunar
        assertEquals("六", lunar.yearNineStar.number)
        assertEquals("五黄土玉衡", lunar.dayNineStar.toString())
    }

    @Test
    fun test2() {
        val lunar = Lunar.fromYmd(2022, 1, 1)
        assertEquals("六白金开阳", lunar.yearNineStar.toString())
        assertEquals("四绿木天权", lunar.dayNineStar.toString())
    }

    @Test
    fun test3() {
        val lunar = Lunar.fromYmd(2033, 1, 1)
        assertEquals("四绿木天权", lunar.yearNineStar.toString())
        assertEquals("一白水天枢", lunar.dayNineStar.toString())
    }

    @Test
    fun test4() {
        val y = LunarYear.fromYear(1985)
        assertEquals("六白金开阳", y.nineStar.toString())
    }

    @Test
    fun test5() {
        val y = LunarYear.fromYear(2022)
        assertEquals("五黄土玉衡", y.nineStar.toString())
    }

    @Test
    fun test6() {
        val y = LunarYear.fromYear(2033)
        assertEquals("三碧木天玑", y.nineStar.toString())
    }

    @Test
    fun test7() {
        val m = LunarMonth.fromYm(1985, 2)
        assertEquals("四绿木天权", m.nineStar.toString())
    }

    @Test
    fun test8() {
        val m = LunarMonth.fromYm(2022, 1)
        assertEquals("二黑土天璇", m.nineStar.toString())
    }

    @Test
    fun test9() {
        val m = LunarMonth.fromYm(2033, 1)
        assertEquals("五黄土玉衡", m.nineStar.toString())
    }

    @Test
    fun test10() {
        val d = Lunar.fromYmdHms(2033, 1, 1, 12, 0, 0)
        assertEquals("七赤金摇光", d.timeNineStar.toString())
    }

    @Test
    fun test11() {
        val d = Lunar.fromYmdHms(2011, 5, 3, 23, 0, 0)
        assertEquals("七赤金摇光", d.timeNineStar.toString())
    }

    @Test
    fun test12() {
        var m = LunarMonth.fromYm(2024, 11)
        assertEquals("四绿木天权", m.nineStar.toString())
        m = LunarMonth.fromYm(2024, 12)
        assertEquals("三碧木天玑", m.nineStar.toString())
    }
}
